import { Configuration } from '../configuration{{importFileExtension}}'
{{#useInversify}}
import { injectable, inject } from "inversify";
import { AbstractConfiguration } from "../services/configuration";
{{/useInversify}}

/**
 *
 * @export
 */
export const COLLECTION_FORMATS = {
    csv: ",",
    ssv: " ",
    tsv: "\t",
    pipes: "|",
};


/**
 *
 * @export
 * @class BaseAPI
 */
{{#useInversify}}
@injectable()
{{/useInversify}}
export class BaseAPIRequestFactory {

    {{^useErasableSyntax}}
    constructor({{#useInversify}}@inject(AbstractConfiguration) {{/useInversify}}protected configuration: Configuration) {
    }
    {{/useErasableSyntax}}
    {{#useErasableSyntax}}
    protected configuration: Configuration;
    constructor({{#useInversify}}@inject(AbstractConfiguration) {{/useInversify}} config: Configuration) {
        this.configuration = config;
    }
    {{/useErasableSyntax}}
};

/**
 *
 * @export
 * @class RequiredError
 * @extends {Error}
 */
export class RequiredError extends Error {
    override name: "RequiredError" = "RequiredError";
    {{#useErasableSyntax}}
    public api: string;
    public method: string;
    public field: string;
    constructor(api: string, method: string, field: string) {
        super("Required parameter " + field + " was null or undefined when calling " + api + "." + method + ".");
        this.api = api;
        this.method = method;
        this.field = field;
    }
    {{/useErasableSyntax}}
    {{^useErasableSyntax}}
    constructor(public api: string, public method: string, public field: string) {
        super("Required parameter " + field + " was null or undefined when calling " + api + "." + method + ".");
    }
    {{/useErasableSyntax}}
}
